package cn.edu.scau.Bean;

import cn.edu.scau.Jdbc.JdbcUtils;

public class ClassPage {

	// 当前的页面
	private int currentPage = 1;

	// 最大页面数
	private int maxPage;

	// 每一页要展示的条目数
	private int perPage = 5;

	public int getMaxRow() {
		return maxRow;
	}

	public void setMaxRow(int maxRow) {
		this.maxRow = maxRow;
	}

	// 最大行数
	private int maxRow;

	public ClassPage() {

		maxRow = JdbcUtils.getAvaibleCount(this);

		if (maxRow % perPage == 0) {
			this.setMaxPage(this.maxRow / this.perPage);

		} else {
			this.setMaxPage(this.maxRow / this.perPage + 1);
		}

	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public int getMaxPage() {
		return maxPage;
	}

	public void setMaxPage(int maxPage) {
		this.maxPage = maxPage;
	}

	public int getPerPage() {
		return perPage;
	}

	public void setPerPage(int perPage) {
		this.perPage = perPage;
	}
}
